package com.yykj.hospital.server.converter;

import com.yykj.hospital.client.dto.HospitalSettingOnlineDTO;
import com.yykj.hospital.server.model.entity.HospitalSettingOnline;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

public class HospitalSettingOnlineDTOConverter {
    public static HospitalSettingOnlineDTO convert(HospitalSettingOnline setting){
        HospitalSettingOnlineDTO dto = new HospitalSettingOnlineDTO();
        BeanUtils.copyProperties(setting,dto);
        return dto;
    }
    public static List<HospitalSettingOnlineDTO> convert(List<HospitalSettingOnline> settingList){
        return settingList.stream().map(HospitalSettingOnlineDTOConverter::convert).collect(Collectors.toList());
    }
}
